<template>
  <div class="school">
      <h2>我是School组件</h2>
      <h3>学校名称:{{name}}</h3>
      <h3>学校地址:{{address}}</h3>
      <button @click="sendName(name,address)">点我传递给父组件名称</button>
      <!-- <button @click="jiebang">事件解绑</button> -->
  </div>
</template>

<script>
  export default {
    name:'School',
    data(){
        return {
            name:'衡水一中',
            address:'我也不知道'
        }
    },
    methods: {
        sendName(name,address){
          this.$emit('haha',name,address)
        },
        // FIXME: 事件解绑方法
        // jiebang(){
        //   this.$off('haha')
        // },
    },

  }
</script>

<style scoped>
  .school{
      background-color: rgb(120, 182, 224);
  }
</style>